package org.wkg.lesson07;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class Demo_702 {

    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<Integer> queue = new LinkedBlockingQueue<>(3);
        queue.put(1);
        queue.put(2);
        queue.put(3);
        System.out.println("插入了3个ed");
        /*queue.put(4);
        System.out.println("插入了4个ed");*/

        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println("取出了3个");
        /*System.out.println(queue.take());
        System.out.println("取出了4个");*/
    }



}
